﻿@model Message
           
<li class="mainbox viewthread" id="msg@(Model.Id)">

<table cellpadding="0" cellspacing="0">
<tr>
    <td class="postauthor" rowspan="2">
        <div class="postinfo">@Model.User.UserName</div>
        <div>
            @if (Model.User.Photo != null)
            {
				<div class="photo"><img src="@Model.User.Photo" alt="@Model.User.UserName" /></div>
            }
            else
            {
                <div class="photo">@Html.Img("~/images/itourya.jpg", "default")</div>
            }
            <p>
                @T("Member for:") @Html.Partial("SinceDate", Model.User.RegistrationDate)
            </p>
            <p>
                帖子数 @Model.User.TopicCount
            </p>
            <p>
                精华贴 @Model.User.StickyCount
            </p>
        </div>
    </td>
    <td class="postcontent">
        <div class="postinfo">
            <strong class="number">
			    <a class="msgId" rel="nofollow"
				href="@(ViewData.Get<bool>("FullUrl", false) ? Url.Action(null, null, new { page = 0 }) : "")#msg@(Model.Id)" 
				onclick="window.location.hash='#msg@(Model.Id)';return false;"><em>@(Model.Id)</em><sup>#</sup></a>
		    </strong>
            <div class="posterinfo">
                发表于 @Html.Partial("SinceDate", Model.Date) 前 | @Html.ActionLink("只看该作者", "Detail", "Users", new { id = Model.User.Id }, new { rel = "nofollow" })
            </div>
        </div>
        <div class="defaultpost">
            @if (this.Model.Active)
            {
			    @Html.Raw(Model.Body)
            }
            else
            {
			    <p class="removed">@T("The message was removed by a forum moderator.")</p>
            }
        </div>
    </td>
</tr>

<tr>
    <td class="postcontent postbottom"></td>
</tr>

<tr>
    <td class="postauthor"></td>
    <td class="postcontent">

    <div class="postactions">
        <div class="postact s_clear">
            @Html.LinkLocalized("link", (ViewData.Get<bool>("FullUrl", false) ? Url.Action(null, null, new { page = 0 }) : "") + "#msg" + Model.Id, new { @class = "first" })
		    <em>
            @if (ViewData.GetDefault<bool>("HasPostAccess"))
                {
			        @Html.ActionLinkLocalized("reply", "Add", "Messages", new { msg = Model.Id }, new { rel = "nofollow" })
                }
            </em>
		    @if (Model.Active)
            {
                if (Role >= UserRole.Moderator)
                {
				    @Html.LinkLocalized("remove", "#", new { onclick = "return deleteMessage(" + Model.Id + ", '" + @Url.Action("Delete", "Messages") + "');" })
                }
			    @Html.LinkLocalized("flag", "#", new { onclick = "return flagMessage(" + Model.Id + ", '" + @Url.Action("Flag", "Messages") + "');" })
            }
           
            <p>
                <a href="javascript:;" onclick="scrollTo(0,0);">TOP</a>
            </p>
        </div>
    </div>

    </td>
</tr>
<tr class="threadad">
    <td class="postauthor"></td>
    <td class="adcontent"></td>
</tr>

	@*@if (Config.UI.ShowUserDetailsOnList)
 {
		<div class="msgUser group@((int)Model.User.Role)">
			@if (Model.User.Photo != null)
   {
				<div class="photo"><img src="@Model.User.Photo" alt="@Model.User.UserName" /></div>
   }
   else
   {
                <div class="photo">@Html.Img("~/images/itourya.jpg", "default")</div>
   }
			<div class="userName"><strong>@Model.User.UserName</strong></div>
			<div class="groupName"><span>@Model.User.RoleName</span></div>
			<div class="memberSince">@T("Member for:") @Html.Partial("SinceDate", Model.User.RegistrationDate)</div>
		</div>
 }
	<div class="msgHeader">
		<strong class="number">
			<a class="msgId" rel="nofollow"
				href="@(ViewData.Get<bool>("FullUrl", false) ? Url.Action(null, null, new { page = 0 }) : "")#msg@(Model.Id)" 
				onclick="window.location.hash='#msg@(Model.Id)';return false;">#@(Model.Id)</a>
		</strong>
		<span class="userSep">
		@T("by")
		</span>
		<strong class="userName">@Html.ActionLink(Model.User.UserName, "Detail", "Users", new { id = Model.User.Id }, new { rel = "nofollow" })</strong>
		<span class="dateSep">
		 
		</span>
		@Html.Date(Model.Date)
	</div>
	<div class="msgBody">
		@if (this.Model.Active)
  {
			@Html.Raw(Model.Body)
  }
  else
  {
			<p class="removed">@T("The message was removed by a forum moderator.")</p>
  }
	</div>
	<div class="msgOptions">
		@Html.LinkLocalized("link", (ViewData.Get<bool>("FullUrl", false) ? Url.Action(null, null, new { page = 0 }) : "") + "#msg" + Model.Id, new { @class = "first" })
		@if (ViewData.GetDefault<bool>("HasPostAccess"))
  {
			@Html.ActionLinkLocalized("reply", "Add", "Messages", new { msg = Model.Id }, new { rel = "nofollow" })
  }
		@if (Model.Active)
  {
      if (Role >= UserRole.Moderator)
      {
				        @Html.LinkLocalized("remove", "#", new { onclick = "return deleteMessage(" + Model.Id + ", '" + @Url.Action("Delete", "Messages") + "');" })
      }
			   @Html.LinkLocalized("flag", "#", new { onclick = "return flagMessage(" + Model.Id + ", '" + @Url.Action("Flag", "Messages") + "');" })
  }
	</div>*@
    </table>
</li>